import { defineStore } from "pinia"
import { reactive, ref, toRef } from "vue"
export const useUserStore =  defineStore('userStore', () => {
    const userStore = reactive({
        token:'abcdeffdsfdsfsdfds',
        loginStatus:true
    })
    const changeLoginStatus=()=>{
        userStore.money += 100
        userStore.loginStatus=!userStore.loginStatus
    }
    const money = ref(100)


    const addMoney=()=>{
        console.log('add money')
        money.value += 100
    }
    return {
        userStore,
        changeLoginStatus,
        addMoney,
        money
    }   
},{
    persistance: true

})